package com.zhuxulin.java.email.busness;

import java.io.IOException;
import java.text.Normalizer.Form;
import java.util.Date;

import org.apache.commons.mail.EmailException;

import com.zhuxulin.java.email.fildder.LineHandler;
import com.zhuxulin.java.email.mail.SendSimpleEmail;
import com.zhuxulin.java.email.mail.bean.SimpleEmailMessage;
import com.zhuxulin.java.email.utils.FormatUtil;
import com.zhuxulin.java.email.utils.ReadFileUtil;
import com.zhuxulin.java.email.utils.WriteFileUtil;

/**
 * 解析由Fildder抓包的文件，保存到TXT文件当中去
 * 
 * @author ZhuXulin
 * 
 */
public class ParseFildderFileQQList {
	public static void main(String[] args) {
		/** Fildder抓包导出的附近的人列表 */
		String fileName = "C:\\Users\\Hacker\\Desktop\\66_Full.txt";
		/** 要发送的邮件内容 */
		String textName = "C:\\Users\\Hacker\\Desktop\\mail.txt";
		String destName = "C:\\Users\\Hacker\\Desktop\\" + FormatUtil.formatDate(new Date()) + ".txt";
		LineHandler hanlder = new LineHandler();
		ReadFileUtil.readFileByLines(fileName, hanlder);
		int i = 1;
		for (String s : hanlder.getAsQQMailList()) {
			System.out.println("num:" + i + "     " + s);
			i++;
			try {
				WriteFileUtil.write(destName, s);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		System.out.println("Total:" + i);
	}
}
